<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<base href="<%=basePath%>">
<style type="text/css">
* {
	padding: 0px;
	margin: 0px auto;
}

headed {
	display: inline-block;
	position: fixed;
	top: 0px;
	left: 0px;
	background: #ccc;
	height: 30px;
	width: 100%;
	color: #FFF;
	line-height: 30px;
	text-align: center;
}

.dataInfo {
	width: 90%;
	margin-top: 40px;
	text-align: center;
}

.dataInfo>div {
	height: 300px;
	overflow-y: scroll;
	text-align: center;
	border: 1px solid #ccc;
}
</style>
<script type="text/javascript" src="js/jquery-1.11.3.js"></script>
<script type="text/javascript">
    	$(function(){
    		$.post("json/Product_findProductInfo",null,function(data){
    			if(data.obj==null){
    				$("#loginInfo").html("请先登录...");
    			}else{
    				$("#loginInfo").html("当前登录用户："+data.obj.uname);
    			}
    			
    			var info1=""; //正在拍卖的
    			var info2=""; //即将拍卖的
    			
    			$.each(data.rows,function(index,item){
    				if(item.flag==1){
    					info1+="<tr><td><img src='"+item.pic+"'/></td><td>"+item.pid+"</td><td>"+item.pname+"</td><td>"+
    					item.startPrice+"</td><td>"+item.savePrice+"</td><td>"+item.endDate+"</td><td><a href=''>竞拍</a></td></tr>"
    				}else{
    					info2+="<tr><td><img src='"+item.pic+"'/></td><td>"+item.pid+"</td><td>"+item.pname+"</td><td>"+
    					item.startPrice+"</td><td>"+item.savePrice+"</td><td>"+item.beginDate+"</td><td><a href=''>查看</a></td></tr>"
    				}
    			});
    			
    			$("#productInfo1").html("").append($(info1));
    			$("#productInfo2").html("").append($(info2));
    			
    		},"json");
    	});
    </script>
</head>

<body>
	<headed> <span id="loginInfo">当前登录用户：张三</span> </headed>

	<div class="dataInfo">
		<h2>正在拍卖</h2>
		<div>
			<table align="center" width="100%" border="1px" cellspacing="0px"
				cellpadding="0px">
				<thead>
					<tr>
						<th>图片</th>
						<th>商品编号</th>
						<th>商品名称</th>
						<th>起拍价</th>
						<th>保留价</th>
						<th>结束日期</th>
						<th>操作</th>
					</tr>
				</thead>
				<tbody id="productInfo1">

				</tbody>
			</table>
		</div>

		<h2>即将拍卖</h2>
		<div>
			<table align="center" width="100%" border="1px" cellspacing="0px"
				cellpadding="0px">
				<thead>
					<tr>
						<th>图片</th>
						<th>商品编号</th>
						<th>商品名称</th>
						<th>起拍价</th>
						<th>保留价</th>
						<th>开拍日期</th>
						<th>操作</th>
					</tr>
				</thead>
				<tbody id="productInfo2">

				</tbody>
			</table>
		</div>
	</div>
</body>
</html>
